<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var arr1 = [1, 2, 3, 4];
        var arr2 = [5, 6, 7, 8];
        //拼接数组arr1,arr2
        arr1.push(5, 6, 7, 8);
        arr1.push.apply(null, arr2);

        var arr3 = [1, 5, 8, 2, 0, -2, 20];
        //求数组的最大值和最小值
        Math.max.apply(null, arr3);
        Math.min.apply(null, arr3);
    </script>
</body>

</html>